<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/container/variant.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_e0f5f6345e438c73b9ae78ec2940718c.html">container</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">variant.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d9/d7a/variant_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;assert.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;typeinfo&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#include &lt;stdexcept&gt;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="comment">// 默认开启类型检查。</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="comment">// 如果要关闭可以在工程文件中添加自己的定义, 比如在Makefile中增加 -DVARIANT_USE_TYPE_CHECK=0</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#if !defined( VARIANT_USE_TYPE_CHECK )</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="../../d9/d7a/variant_8hpp.html#a9a62f0c913a8edaf663007a48e467427">   22</a></span><span class="preprocessor">#    define VARIANT_USE_TYPE_CHECK  (1)</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d8d/namespacewheels.html">wheels</a></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>{</div>
<div class="foldopen" id="foldopen00028" data-start="{" data-end="}">
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../d8/dc1/namespacewheels_1_1private____.html">   28</a></span>    <span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/da4/namespaceprivate____.html">private__</a>{</div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="};">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">   29</a></span>        <span class="keyword">class </span><a class="code hl_class" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">variant_base__</a>{</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>        <span class="keyword">public</span>:</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ae8c5c95bc210720e3fe3a31387f56818">   31</a></span>            <span class="keyword">virtual</span> <a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ae8c5c95bc210720e3fe3a31387f56818">~variant_base__</a>(){}</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#a10c64565c7edc02f3267c334a41261de">   32</a></span>            <span class="keyword">virtual</span> <a class="code hl_class" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">variant_base__</a> * <a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#a10c64565c7edc02f3267c334a41261de">clone</a>() = 0;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>            <span class="comment">// 如果需要检查操作的时候需要检查数据，则在编译的时候要定义宏</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>            <span class="comment">// 并将宏的值配置成1</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ab144858a318a44cb8541a6165272938a">   36</a></span>            <span class="keyword">virtual</span> <span class="keyword">const</span> std::string <a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ab144858a318a44cb8541a6165272938a">typeInfo</a>() <span class="keyword">const</span>= 0;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>        };</div>
</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>        <span class="comment">// *********************************************************************************************************************</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> T &gt;</div>
<div class="foldopen" id="foldopen00042" data-start="{" data-end="};">
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">   42</a></span>        <span class="keyword">class </span><a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">variant__</a> : <span class="keyword">public</span> <a class="code hl_class" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">variant_base__</a>{</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>        <span class="keyword">public</span>:</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a2062621db40e354429790efdf581c20e">   44</a></span>            <span class="keyword">using </span><a class="code hl_typedef" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a2062621db40e354429790efdf581c20e">data_t</a> = <span class="keyword">typename</span> std::remove_pointer&lt; typename std::decay&lt;T&gt;::type &gt;::type;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>        <span class="keyword">private</span>:</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>            T    m_data__;    <span class="comment">// 实际数据内容</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>        <span class="keyword">public</span>:</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ace0281dab6767169e03ad3d3b574ad2f">   48</a></span>            <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ace0281dab6767169e03ad3d3b574ad2f">variant__</a>(){}</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a7aee519767f7ed1e55d9f2ef7dd2394e">   49</a></span>            <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a7aee519767f7ed1e55d9f2ef7dd2394e">variant__</a>( <span class="keyword">const</span> T&amp; value ) : m_data__(value){}</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a8d5bcda487f9901d5c91d99ce8a74a15">   50</a></span>            <span class="keyword">virtual</span> <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a8d5bcda487f9901d5c91d99ce8a74a15">~variant__</a>(){}</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>            </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#aa6260db0d2704c9def326b5af22dc95d">   52</a></span>            T <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#aa6260db0d2704c9def326b5af22dc95d">get</a>(){ <span class="keywordflow">return</span> m_data__; }</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="foldopen" id="foldopen00054" data-start="{" data-end="}">
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a3788a47fb19669e9034881be8edc564d">   54</a></span>            <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a3788a47fb19669e9034881be8edc564d">set</a>( <span class="keyword">const</span> T&amp; b ){</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>                m_data__ = b;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>            }</div>
</div>
<div class="foldopen" id="foldopen00061" data-start="{" data-end="}">
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ae3279572f053c6f519e914ebf7b6cd32">   61</a></span>            <span class="keyword">virtual</span> <a class="code hl_class" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">variant_base__</a> *<a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ae3279572f053c6f519e914ebf7b6cd32">clone</a>() final{</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>                <a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">variant__&lt; T &gt;</a> * ret = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>                </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>                <span class="keywordflow">try</span>{</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>                    ret = <span class="keyword">new</span> <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ace0281dab6767169e03ad3d3b574ad2f">variant__&lt; T &gt;</a>();</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>                    ret-&gt;m_data__ = m_data__;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>                }<span class="keywordflow">catch</span>( std::bad_alloc&amp; e ){</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>                    ret = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>                }</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>                <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>            }</div>
</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a193da234ce5f1084b85823f97ccc482f">   74</a></span>            <span class="keyword">virtual</span> <span class="keyword">const</span> std::string <a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a193da234ce5f1084b85823f97ccc482f">typeInfo</a>() const final{</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>                <span class="keywordflow">return</span> std::string( <span class="keyword">typeid</span>( T ).name() );</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>            }</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>        };</div>
</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    }</div>
</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    <span class="comment">// ***************************************************************************************************************************</span></div>
<div class="foldopen" id="foldopen00082" data-start="{" data-end="};">
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html">   82</a></span>    <span class="keyword">class </span><a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>{</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>        <a class="code hl_class" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">private__::variant_base__</a> *    p_data__;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>        std::string                    m_typeinfo__;    <span class="comment">// 保存数据类型描述</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>        </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>        <span class="keyword">mutable</span> std::mutex             m_mutex__;     <span class="comment">//</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#ab244c1e9da7b1706c621ddcbf2a46ac8">   93</a></span>        <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ab244c1e9da7b1706c621ddcbf2a46ac8">variant</a>():p_data__( nullptr ){}     </div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#ab2c73065acc6e8ff534c29380e5f5267">   94</a></span>        <span class="keyword">virtual</span> <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ab2c73065acc6e8ff534c29380e5f5267">~variant</a>(){</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>            <span class="keywordflow">if</span>( p_data__ ){</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>                <span class="keyword">delete</span> p_data__;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>            }</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>        }</div>
</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span> </div>
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a4268327eff89955ffc2e89c5f119e4e6">  100</a></span>        <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a4268327eff89955ffc2e89c5f119e4e6">variant</a>( <span class="keyword">const</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; b ) : p_data__( nullptr )</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>        {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>            <span class="keywordflow">if</span>( b.p_data__ ){</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>            p_data__ = b.p_data__-&gt;<a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#a10c64565c7edc02f3267c334a41261de">clone</a>();</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>            m_typeinfo__ = b.p_data__-&gt;<a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ab144858a318a44cb8541a6165272938a">typeInfo</a>();</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>            }</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>        }</div>
</div>
<div class="foldopen" id="foldopen00109" data-start="{" data-end="}">
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a83699fcc96903b96a9f91677081edba3">  109</a></span>        <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a83699fcc96903b96a9f91677081edba3">variant</a>( <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp;&amp; b ): p_data__( nullptr )</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>        {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>            <span class="keyword">auto</span> * __p_temp = p_data__;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>            p_data__ = b.p_data__;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>            b.p_data__ = __p_temp;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>            <span class="keyword">auto</span> __p_t = m_typeinfo__;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>            m_typeinfo__ = b.m_typeinfo__;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>            b.m_typeinfo__ = __p_t;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>        }</div>
</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span> </div>
<div class="foldopen" id="foldopen00121" data-start="{" data-end="}">
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a0a99f6cde8104f6843856148c7db4855">  121</a></span>        <span class="keyword">operator</span> bool(){</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>            <span class="keywordflow">return</span> p_data__ != <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>        }</div>
</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>        </div>
<div class="foldopen" id="foldopen00125" data-start="{" data-end="}">
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a9d21b29fe9159c73b71d1819f5ce1d5e">  125</a></span>        <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a9d21b29fe9159c73b71d1819f5ce1d5e">operator=</a>( <span class="keyword">const</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; b ){</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>            p_data__ = b.p_data__-&gt;<a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#a10c64565c7edc02f3267c334a41261de">clone</a>();</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>            m_typeinfo__ = b.p_data__-&gt;<a class="code hl_function" href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ab144858a318a44cb8541a6165272938a">typeInfo</a>();</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>        }</div>
</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a6e8f803be85bcf8c1e003b753c26927f">  133</a></span>        <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a6e8f803be85bcf8c1e003b753c26927f">operator=</a>( <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp;&amp; b ){</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>            <span class="keyword">auto</span> * __p_temp = p_data__;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>            p_data__ = b.p_data__;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>            b.p_data__ = __p_temp;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>            <span class="keyword">auto</span> __p_t = m_typeinfo__;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>            m_typeinfo__ = b.m_typeinfo__;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>            b.m_typeinfo__ = __p_t;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>        }</div>
</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a4b8e2093c098cb2550538250e538cea8">  145</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a4b8e2093c098cb2550538250e538cea8">operator=</a>( <span class="keywordtype">bool</span> data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a9fab42b39660ff96b6b79f7782ffcbaf">  146</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a9fab42b39660ff96b6b79f7782ffcbaf">operator=</a>( <span class="keywordtype">char</span> data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>(data); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#aa100f5d73f89a801a4723d74dcd8955e">  147</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#aa100f5d73f89a801a4723d74dcd8955e">operator=</a>( <span class="keywordtype">short</span> data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a452d21d0b0b4cc3d66bf870d47269c97">  148</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a452d21d0b0b4cc3d66bf870d47269c97">operator=</a>( <span class="keywordtype">int</span> data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a9c18ec0f0610d73394ce242e28bca6c2">  149</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a9c18ec0f0610d73394ce242e28bca6c2">operator=</a>( int64_t data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#af63ce3bf0213ecbdc43ed0eb094d2961">  150</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#af63ce3bf0213ecbdc43ed0eb094d2961">operator=</a>( uint8_t data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>(data); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#af2402abdfba6298e90bde4c457a3bc8d">  151</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#af2402abdfba6298e90bde4c457a3bc8d">operator=</a>( uint16_t data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a308b14c66174c547f66f4e4d1bdbfa14">  152</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a308b14c66174c547f66f4e4d1bdbfa14">operator=</a>( uint32_t data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a5c425e3849c9a64bb5e5882daaa15f00">  153</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a5c425e3849c9a64bb5e5882daaa15f00">operator=</a>( uint64_t data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#afdad53e322fab2850cddfe142793c231">  154</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#afdad53e322fab2850cddfe142793c231">operator=</a>( <span class="keywordtype">float</span> data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#ad5daa33f2719f09880e0434bc3c1709f">  155</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad5daa33f2719f09880e0434bc3c1709f">operator=</a>( <span class="keywordtype">double</span> data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span> </div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a1497ad76726d662b48b0a0e6f97a7fc2">  157</a></span>        <span class="keyword">inline</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>&amp; <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a1497ad76726d662b48b0a0e6f97a7fc2">operator=</a>( <span class="keyword">const</span> std::string&amp; data ){ <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( data ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>        </div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> dataType &gt;</div>
<div class="foldopen" id="foldopen00167" data-start="{" data-end="}">
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#aec8c6372866cf7fd422a96e1164aa5c3">  167</a></span>        <span class="keyword">static</span> <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a> <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#aec8c6372866cf7fd422a96e1164aa5c3">make</a>( <span class="keyword">const</span> dataType&amp; data ){</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>            <a class="code hl_class" href="../../dd/d54/classwheels_1_1variant.html">variant</a>  ret;</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>            ret.m_typeinfo__ = <span class="keyword">typeid</span>( dataType ).name();</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span><span class="preprocessor">#endif          </span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>            ret.p_data__ = <span class="keyword">new</span> <a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">private__::variant__&lt; dataType &gt;</a>( data );</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>            <span class="keywordflow">return</span> ret ;</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>        }</div>
</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span> </div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> dataType &gt;</div>
<div class="foldopen" id="foldopen00177" data-start="{" data-end="}">
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#aced76c3bf530e5ea5aa73c0b04b1094a">  177</a></span>        dataType <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#aced76c3bf530e5ea5aa73c0b04b1094a">get</a>( )<span class="keyword">const</span>{</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>            std::lock_guard&lt; std::mutex &gt; lock( m_mutex__ );</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>            <a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">private__::variant__&lt;dataType&gt;</a>  * p = <span class="keyword">static_cast&lt;</span> <a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">private__::variant__&lt;dataType&gt;</a> *<span class="keyword">&gt;</span>( p_data__ );</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>            <span class="keywordflow">if</span>( !p ){</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>                <span class="keywordflow">throw</span> std::runtime_error( <span class="stringliteral">&quot;数据内容无效&quot;</span> );</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>            }</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>            <span class="keyword">auto</span> str = <span class="keyword">typeid</span>( dataType ).name();</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span>            <span class="keywordflow">if</span>( m_typeinfo__ != str ){</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>                <span class="keywordflow">throw</span> std::runtime_error( <span class="stringliteral">&quot;数据类型不匹配&quot;</span> );</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>            }</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>            <span class="keywordflow">return</span> p-&gt;<a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#aa6260db0d2704c9def326b5af22dc95d">get</a>();</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>        }</div>
</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> dataType &gt;</div>
<div class="foldopen" id="foldopen00204" data-start="{" data-end="}">
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a60ffd84ab9e5d23a7081e85f729ff8b9">  204</a></span>        <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a60ffd84ab9e5d23a7081e85f729ff8b9">is</a>(){</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>              <span class="keywordflow">return</span> (m_typeinfo__ == <span class="keyword">typeid</span>( dataType ).name());</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>        }</div>
</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>        </div>
<div class="foldopen" id="foldopen00208" data-start="{" data-end="}">
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#a555277943832ea29db741c039d101e37">  208</a></span>        std::string <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#a555277943832ea29db741c039d101e37">typeInfo</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span>            std::lock_guard&lt; std::mutex&gt; lck( m_mutex__);</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>            <span class="keywordflow">return</span> m_typeinfo__;</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>        }</div>
</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>        </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> dataType &gt;</div>
<div class="foldopen" id="foldopen00217" data-start="{" data-end="}">
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"><a class="line" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">  217</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">set</a>( <span class="keyword">const</span> dataType&amp; data ){</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>            std::lock_guard&lt; std::mutex &gt; lock( m_mutex__ );</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span><span class="preprocessor">#if VARIANT_USE_TYPE_CHECK</span></div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>            assert( m_typeinfo__ ==  <span class="keyword">typeid</span>( dataType ).name() );</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>            <a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">private__::variant__&lt;dataType&gt;</a>  * p = <span class="keyword">static_cast&lt;</span> <a class="code hl_class" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">private__::variant__&lt;dataType&gt;</a>* <span class="keyword">&gt;</span>( p_data__ );</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>            <span class="keywordflow">if</span>( p ){</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>                <span class="keywordflow">return</span> p-&gt;<a class="code hl_function" href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a3788a47fb19669e9034881be8edc564d">set</a>( data );</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>            }<span class="keywordflow">else</span>{</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span>                <span class="keywordflow">throw</span> std::runtime_error( <span class="stringliteral">&quot;数据内存错误&quot;</span> );</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span>            }</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span>        }</div>
</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span> </div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>                </div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>    };</div>
</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span> </div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>}</div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html">wheels::private__::variant__</a></div><div class="ttdef"><b>定义</b> <a href="#l00042">variant.hpp:42</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_a193da234ce5f1084b85823f97ccc482f"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a193da234ce5f1084b85823f97ccc482f">wheels::private__::variant__::typeInfo</a></div><div class="ttdeci">virtual const std::string typeInfo() const final</div><div class="ttdef"><b>定义</b> <a href="#l00074">variant.hpp:74</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_a2062621db40e354429790efdf581c20e"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a2062621db40e354429790efdf581c20e">wheels::private__::variant__::data_t</a></div><div class="ttdeci">typename std::remove_pointer&lt; typename std::decay&lt; T &gt;::type &gt;::type data_t</div><div class="ttdef"><b>定义</b> <a href="#l00044">variant.hpp:44</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_a3788a47fb19669e9034881be8edc564d"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a3788a47fb19669e9034881be8edc564d">wheels::private__::variant__::set</a></div><div class="ttdeci">void set(const T &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00054">variant.hpp:54</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_a7aee519767f7ed1e55d9f2ef7dd2394e"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a7aee519767f7ed1e55d9f2ef7dd2394e">wheels::private__::variant__::variant__</a></div><div class="ttdeci">variant__(const T &amp;value)</div><div class="ttdef"><b>定义</b> <a href="#l00049">variant.hpp:49</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_a8d5bcda487f9901d5c91d99ce8a74a15"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#a8d5bcda487f9901d5c91d99ce8a74a15">wheels::private__::variant__::~variant__</a></div><div class="ttdeci">virtual ~variant__()</div><div class="ttdef"><b>定义</b> <a href="#l00050">variant.hpp:50</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_aa6260db0d2704c9def326b5af22dc95d"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#aa6260db0d2704c9def326b5af22dc95d">wheels::private__::variant__::get</a></div><div class="ttdeci">T get()</div><div class="ttdef"><b>定义</b> <a href="#l00052">variant.hpp:52</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_ace0281dab6767169e03ad3d3b574ad2f"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ace0281dab6767169e03ad3d3b574ad2f">wheels::private__::variant__::variant__</a></div><div class="ttdeci">variant__()</div><div class="ttdef"><b>定义</b> <a href="#l00048">variant.hpp:48</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant_____html_ae3279572f053c6f519e914ebf7b6cd32"><div class="ttname"><a href="../../d6/d33/classwheels_1_1private_____1_1variant____.html#ae3279572f053c6f519e914ebf7b6cd32">wheels::private__::variant__::clone</a></div><div class="ttdeci">virtual variant_base__ * clone() final</div><div class="ttdoc">拷贝操作。主要用于外部的拷贝构造、赋值拷贝。</div><div class="ttdef"><b>定义</b> <a href="#l00061">variant.hpp:61</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant__base_____html"><div class="ttname"><a href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html">wheels::private__::variant_base__</a></div><div class="ttdef"><b>定义</b> <a href="#l00029">variant.hpp:29</a></div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant__base_____html_a10c64565c7edc02f3267c334a41261de"><div class="ttname"><a href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#a10c64565c7edc02f3267c334a41261de">wheels::private__::variant_base__::clone</a></div><div class="ttdeci">virtual variant_base__ * clone()=0</div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant__base_____html_ab144858a318a44cb8541a6165272938a"><div class="ttname"><a href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ab144858a318a44cb8541a6165272938a">wheels::private__::variant_base__::typeInfo</a></div><div class="ttdeci">virtual const std::string typeInfo() const =0</div></div>
<div class="ttc" id="aclasswheels_1_1private_____1_1variant__base_____html_ae8c5c95bc210720e3fe3a31387f56818"><div class="ttname"><a href="../../d3/d39/classwheels_1_1private_____1_1variant__base____.html#ae8c5c95bc210720e3fe3a31387f56818">wheels::private__::variant_base__::~variant_base__</a></div><div class="ttdeci">virtual ~variant_base__()</div><div class="ttdef"><b>定义</b> <a href="#l00031">variant.hpp:31</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html">wheels::variant</a></div><div class="ttdoc">实际暴露出来的接口类。这个类具有明确的类型，可以在其他容器中，比如vector中，使用</div><div class="ttdef"><b>定义</b> <a href="#l00082">variant.hpp:82</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a1497ad76726d662b48b0a0e6f97a7fc2"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a1497ad76726d662b48b0a0e6f97a7fc2">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(const std::string &amp;data)</div><div class="ttdef"><b>定义</b> <a href="#l00157">variant.hpp:157</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a308b14c66174c547f66f4e4d1bdbfa14"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a308b14c66174c547f66f4e4d1bdbfa14">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(uint32_t data)</div><div class="ttdef"><b>定义</b> <a href="#l00152">variant.hpp:152</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a4268327eff89955ffc2e89c5f119e4e6"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a4268327eff89955ffc2e89c5f119e4e6">wheels::variant::variant</a></div><div class="ttdeci">variant(const variant &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00100">variant.hpp:100</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a452d21d0b0b4cc3d66bf870d47269c97"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a452d21d0b0b4cc3d66bf870d47269c97">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(int data)</div><div class="ttdef"><b>定义</b> <a href="#l00148">variant.hpp:148</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a4b8e2093c098cb2550538250e538cea8"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a4b8e2093c098cb2550538250e538cea8">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(bool data)</div><div class="ttdoc">针对=进行重载方便赋值</div><div class="ttdef"><b>定义</b> <a href="#l00145">variant.hpp:145</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a555277943832ea29db741c039d101e37"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a555277943832ea29db741c039d101e37">wheels::variant::typeInfo</a></div><div class="ttdeci">std::string typeInfo() const</div><div class="ttdef"><b>定义</b> <a href="#l00208">variant.hpp:208</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a5c425e3849c9a64bb5e5882daaa15f00"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a5c425e3849c9a64bb5e5882daaa15f00">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(uint64_t data)</div><div class="ttdef"><b>定义</b> <a href="#l00153">variant.hpp:153</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a60ffd84ab9e5d23a7081e85f729ff8b9"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a60ffd84ab9e5d23a7081e85f729ff8b9">wheels::variant::is</a></div><div class="ttdeci">bool is()</div><div class="ttdoc">判断类型是否相符合. 例如： if( is&lt;int&gt;() ){ do something ... ... }</div><div class="ttdef"><b>定义</b> <a href="#l00204">variant.hpp:204</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a6e8f803be85bcf8c1e003b753c26927f"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a6e8f803be85bcf8c1e003b753c26927f">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(variant &amp;&amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00133">variant.hpp:133</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a83699fcc96903b96a9f91677081edba3"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a83699fcc96903b96a9f91677081edba3">wheels::variant::variant</a></div><div class="ttdeci">variant(variant &amp;&amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00109">variant.hpp:109</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a9c18ec0f0610d73394ce242e28bca6c2"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a9c18ec0f0610d73394ce242e28bca6c2">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(int64_t data)</div><div class="ttdef"><b>定义</b> <a href="#l00149">variant.hpp:149</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a9d21b29fe9159c73b71d1819f5ce1d5e"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a9d21b29fe9159c73b71d1819f5ce1d5e">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(const variant &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00125">variant.hpp:125</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_a9fab42b39660ff96b6b79f7782ffcbaf"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#a9fab42b39660ff96b6b79f7782ffcbaf">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(char data)</div><div class="ttdef"><b>定义</b> <a href="#l00146">variant.hpp:146</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_aa100f5d73f89a801a4723d74dcd8955e"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#aa100f5d73f89a801a4723d74dcd8955e">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(short data)</div><div class="ttdef"><b>定义</b> <a href="#l00147">variant.hpp:147</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_ab244c1e9da7b1706c621ddcbf2a46ac8"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#ab244c1e9da7b1706c621ddcbf2a46ac8">wheels::variant::variant</a></div><div class="ttdeci">variant()</div><div class="ttdef"><b>定义</b> <a href="#l00093">variant.hpp:93</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_ab2c73065acc6e8ff534c29380e5f5267"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#ab2c73065acc6e8ff534c29380e5f5267">wheels::variant::~variant</a></div><div class="ttdeci">virtual ~variant()</div><div class="ttdef"><b>定义</b> <a href="#l00094">variant.hpp:94</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_aced76c3bf530e5ea5aa73c0b04b1094a"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#aced76c3bf530e5ea5aa73c0b04b1094a">wheels::variant::get</a></div><div class="ttdeci">dataType get() const</div><div class="ttdef"><b>定义</b> <a href="#l00177">variant.hpp:177</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_ad4350db8e628c8e2eb44f1e943a7be48"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#ad4350db8e628c8e2eb44f1e943a7be48">wheels::variant::set</a></div><div class="ttdeci">void set(const dataType &amp;data)</div><div class="ttdoc">指定数据</div><div class="ttdef"><b>定义</b> <a href="#l00217">variant.hpp:217</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_ad5daa33f2719f09880e0434bc3c1709f"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#ad5daa33f2719f09880e0434bc3c1709f">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(double data)</div><div class="ttdef"><b>定义</b> <a href="#l00155">variant.hpp:155</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_aec8c6372866cf7fd422a96e1164aa5c3"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#aec8c6372866cf7fd422a96e1164aa5c3">wheels::variant::make</a></div><div class="ttdeci">static variant make(const dataType &amp;data)</div><div class="ttdoc">构建数据对象</div><div class="ttdef"><b>定义</b> <a href="#l00167">variant.hpp:167</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_af2402abdfba6298e90bde4c457a3bc8d"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#af2402abdfba6298e90bde4c457a3bc8d">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(uint16_t data)</div><div class="ttdef"><b>定义</b> <a href="#l00151">variant.hpp:151</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_af63ce3bf0213ecbdc43ed0eb094d2961"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#af63ce3bf0213ecbdc43ed0eb094d2961">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(uint8_t data)</div><div class="ttdef"><b>定义</b> <a href="#l00150">variant.hpp:150</a></div></div>
<div class="ttc" id="aclasswheels_1_1variant_html_afdad53e322fab2850cddfe142793c231"><div class="ttname"><a href="../../dd/d54/classwheels_1_1variant.html#afdad53e322fab2850cddfe142793c231">wheels::variant::operator=</a></div><div class="ttdeci">variant &amp; operator=(float data)</div><div class="ttdef"><b>定义</b> <a href="#l00154">variant.hpp:154</a></div></div>
<div class="ttc" id="anamespaceprivate_____html"><div class="ttname"><a href="../../d4/da4/namespaceprivate____.html">private__</a></div><div class="ttdoc">代理模式</div><div class="ttdef"><b>定义</b> <a href="../../db/d94/mediator_8hpp_source.html#l00029">mediator.hpp:30</a></div></div>
<div class="ttc" id="anamespacewheels_html"><div class="ttname"><a href="../../df/d8d/namespacewheels.html">wheels</a></div><div class="ttdoc">堆栈信息读取和保存记录</div><div class="ttdef"><b>定义</b> <a href="../../d3/df7/ary__str_8hpp_source.html#l00006">ary_str.hpp:7</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
